using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using RealWorld.Grids;

public partial class Frozen : System.Web.UI.Page
{


    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {

        }
    }

    protected void LoadGrid(object sender, EventArgs e)
    {
        Customer myCustomer1 = new Customer();
        ArrayList custArray = new ArrayList();
        FrozenGrid.Controls.Clear();
        FrozenGridView1.Controls.Clear();
        //also need to set the hidden field
        //to some sate to set both grids top postions to 0

        for (int i = 1; i <= 50; i++)
        {
            myCustomer1.NewCustomer("~\\Images\\pubproperty.gif", i + 1 + "Column 1 and row 1", "Column 2 and row 1");
            custArray.Add(myCustomer1);
        }

        FrozenGrid.DataSource = custArray;
        FrozenGrid.DataBind();
        FrozenGrid.Sort("FirstName", SortDirection.Ascending);
    }

    protected void FrozenGrid_Sorting(object sender, GridViewSortEventArgs e)
    {

    }

    protected void FrozenGrid_RowClicked(object sender, GridViewRowClickedEventArgs args)
    {
        
        FrozenGridView1.Controls.Clear();
        FillGrid();
        HiddenFieldScrollTop.Value = "True";

    }

    protected void FrozenGridView1_RowClicked(object sender, GridViewRowClickedEventArgs args)
    {
        HiddenFieldScrollTop.Value = "False";
    }

    protected void FillGrid()
    {

        Customer myCustomer1 = new Customer();
        ArrayList custArray = new ArrayList();
        FrozenGridView1.Controls.Clear();

        for (int i = 1; i <= 50; i++)
        {
            myCustomer1.NewCustomer("~\\Images\\pubproperty.gif", "Column 1 and row 1", "Column 2 and row 1");
            custArray.Add(myCustomer1);
        }

        FrozenGridView1.DataSource = custArray;
        FrozenGridView1.DataBind();

    }

}



